﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HighFantasyRPG
{
    public class AI
    {
        public int time, delay;
        public int actualcommand, commandcount;
        public bool isOver;

        public AI(int commandcound, int delay)
        {
            this.commandcount = commandcound;
            this.delay = delay * 1000;
            this.time = 0;

        }
        public void Update()
        {
            if (time != delay)
            {

                for (int i = 1; i <= 50; i++)
                {
                    time++;

                    if (time == delay)
                        actualcommand += 1;
                }
                if (actualcommand == commandcount)
                {
                    actualcommand = 0;
                    isOver = true;
                }

            }
            else
            {

                time = 0;

            }


        }

    }
}
